<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>  
<!DOCTYPE html>
<html  ng-app="myApp">
   <head>
        <script src="/website/resources/angular.min.js"></script>
        <script src="/website/resources/angularJS.js/demo.js"></script>
        <link href="/website/resources/angularJS.js/demo.css" rel="stylesheet" type="text/css"/>
   </head>
   <body>
    <div ng-controller="myController" ng-init="init()">
      <form name="myForm" ng-submit="alertOk()" action="/website/user/register" method="post" >
          <div>  
              <label for="name" >账号:</label>
              <input type="text" ng-model="name" required ng-maxlength=20 ng-minlength=2 name="name" id="name" placeholder="请输入姓名">
              <div ng-if="myForm.name.$dirty && myForm.name.$error.required" class="errorinfo labelmargin">姓名必须填写</div>
              <div ng-if="myForm.name.$dirty && myForm.name.$error.maxlength" class="errorinfo labelmargin">不能超过20个字符</div>
              <div ng-if="myForm.name.$dirty && myForm.name.$error.minlength" class="errorinfo labelmargin">最少两个字符</div>
          </div>
         
          <div>  
              <label for="pwd" >密码:</label>
              <!-- ng-pattern="/^[a-zA-Z][\_\@\.]([a-zA-Z0-9]){4,18}$/" -->
              <input type="password" ng-model="pwd" required name="pwd"  id="pwd" placeholder="请输入密码" ng-pattern="/^([a-zA-Z0-9]){6,16}$/">
              <div ng-if="myForm.pwd.$dirty && myForm.pwd.$error.required" class="errorinfo labelmargin">密码必须填写</div>
              <div ng-if="myForm.pwd.$dirty && myForm.pwd.$error.pattern" class="errorinfo labelmargin">最少6个字符，最多16个字符,不包含特殊字符</div>
          </div>          
          <div>  
              <label for="pwd1">确认密码:</label>
              <input type="password" ng-model="pwd1" required name="pwd1"  id="pwd1" placeholder="请输入密码" ng-pattern="pwd"></p>
              <div ng-if="myForm.pwd1.$dirty && myForm.pwd1.$error.required" class="errorinfo labelmargin">密码必须填写</div>
              <div ng-if="myForm.pwd1.$dirty && myForm.pwd1.$error.pattern" class="errorinfo labelmargin">输入的密码不同</div>
          </div>          
          <input type="submit" value="注册" id="submitbtn" ng-disabled="myForm.$invalid" class="labelmargin"/>
      		<a href="/website/user/login">返回登录界面</a>
      </form>
    </div>
    </body>
</html>